// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import echarts from 'echarts'
Vue.prototype.$echarts = echarts

Vue.config.productionTip = false

// 引入elementUI
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// 引入moment 定义全局过滤器
import moment from 'moment'
Vue.filter('dateFormat',function(input,formtstring,weekTrue){
  var weekday = ' 900';
  switch (Number(moment(input).format('d'))){
    case 0: 
      weekday = ' 周日';
      break;
    case 1:
      weekday = ' 周一';
      break;
    case 2:
      weekday = ' 周二';
      break;
    case 3:
      weekday = ' 周三';
      break;
    case 4:
      weekday = ' 周四';
      break;
    case 5:
      weekday = ' 周五';
      break;
    case 6: 
      weekday = ' 周六';
      break;
  }
  if(weekTrue){
    return moment(input).format(formtstring) + weekday;
  } else{
    return moment(input).format(formtstring);
  }
})


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
